#define _CRT_SECURE_NO_WARNINGS
#include"stdio.h"
int func(int a, int n) {
	int sum = 0;
	int temp = 0;
	for (int i = 0; i < n; i++) {
		temp= temp * 10+a;
		sum += temp;
	}
	return sum;
}
int main() {
	int a = 0,sum=0;
	scanf("%d", &a);
	int ref= func(a, 5);
	printf("%d\n",ref);
	//printf("%d\n", func(a, 5));
	return 0;
}